k8s: wait for CoreDNS pods available before proceeding#783
Merged
ahmad-can merged 1 commit intocanonical:mainfrom Apr 24, 2026
Merged
k8s: wait for CoreDNS pods available before proceeding#783ahmad-can merged 1 commit intocanonical:mainfrom
ahmad-can merged 1 commit intocanonical:mainfrom
Conversation
c455cda to
a2fbf69
Compare
There was a problem hiding this comment.
Pull request overview
This PR improves reliability of the OpenStack-on-K8s bootstrap by ensuring CoreDNS is actually serving traffic after the Helm-based CoreDNS HPA/resource patch, instead of relying on the Juju k8s application status (which may lag external changes).
Changes:
- Replace
wait_application_ready()with direct polling of the CoreDNS DeploymentavailableReplicasvia the Kubernetes API. - Add unit tests covering the new CoreDNS readiness wait behavior and updated
PatchCoreDNSStep.run()expectations.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
sunbeam-python/sunbeam/steps/k8s.py |
Adds _wait_for_coredns_ready() and switches PatchCoreDNSStep to poll CoreDNS Deployment availability after Helm upgrade. |
sunbeam-python/tests/unit/sunbeam/steps/test_k8s.py |
Updates PatchCoreDNSStep tests to assert the new readiness wait and adds unit coverage for the polling helper. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
a2fbf69 to
88d215e
Compare
PatchCoreDNSStep runs a helm upgrade to apply HPA and resource settings to CoreDNS. Previously it waited for the k8s Juju application to reach active status, but the k8s charm does not react to external changes until the next update-status hook fires, so the application could be seen as active while CoreDNS pods were still restarting. Replace the Juju application wait with a direct poll of the CoreDNS Deployment's availableReplicas field via the k8s API. The step now waits until availableReplicas >= minReplicas (replica_count), which ensures DNS is fully available before subsequent OpenStack deployment steps proceed. Fixes: LP#2148371 Assisted-By: Claude:claude-4.6-sonnet Signed-off-by: Hemanth Nakkina <hemanth.nakkina@canonical.com>
88d215e to
8985db7
Compare
ahmad-can
approved these changes
Apr 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PatchCoreDNSStep runs a helm upgrade to apply HPA and resource settings to CoreDNS. Previously it waited for the k8s Juju application to reach active status, but the k8s charm does not react to external changes until the next update-status hook fires, so the application could be seen as active while CoreDNS pods were still restarting.
Replace the Juju application wait with a direct poll of the CoreDNS Deployment's availableReplicas field via the k8s API. The step now waits until availableReplicas >= minReplicas (replica_count), which ensures DNS is fully available before subsequent OpenStack deployment steps proceed.
Fixes: LP#2148371
Assisted-By: Claude:claude-4.6-sonnet